# from typing import Union
# from fastapi import FastAPI,Query
#
# app = FastAPI()
#
# @app.get("/")
# async def root():
#     return {"message": "Hello World"}
#
# # @app.get("/items/")
# # async def read_items(
# #     q: Union[str, None] = Query(
# #         default=None,
# #         title="qs",
# #         description="Query string for the items to search in the database that have a good match",
# #         min_length=3,
# #     )
# # ):
# #     results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
# #     if q:
# #         results.update({"q": q})
# #     return results
# @app.get("/items/")
# async def read_items(q: Union[str, None] = Query(default=None, alias="item-query")):
#     results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
#     if q:
#         results.update({"q": q})
#     return results



# from enum import Enum, unique
#
# @unique
# class Weekday(Enum):
#     Sun = 0 # Sun的value被设定为0
#     Mon = 1
#     Tue = 2
#     Wed = 3
#     Thu = 4
#     Fri = 5
#     Sat = 6
#
# for name, member in Weekday.__members__.items():
#     print(name, '=>', member, member.name, member.value)
#


# import functools
#
# def log(func):
#     # @functools.wraps(func)
#     def wrapper(*args, **kw):
#         print('call %s():' % func.__name__)
#         return func(*args, **kw)
#     return wrapper
#
#
#

from typing import Union, Dict
from fastapi import FastAPI,Query

app = FastAPI()

@app.post("/index-weights/")
async def create_index_weights(weights: Dict[str, int]):
    return weights

